#include <iostream>
#include <vector>

/**
 * NowCoder KY 167: Ladder Sum
 */

struct Integer {
    std::vector<uint8_t> digits;

    Integer(const std::vector<uint8_t> digits) : digits(digits) {}

    void operator+=(const Integer &other) {
        int d = other.digits.size() - digits.size();
        for (int i = 0; i < d; i++)
            digits.push_back(0);
        uint8_t carry = 0;
        for (int i = 0; i < digits.size(); i++) {
            uint8_t add = digits[i] + other.digits[i] + carry;
            digits[i] = add % 10;
            carry = add / 10;
        }
        if (carry != 0)
            digits.push_back(carry);
    }

    void print() const {
        for (int i = digits.size() - 1; i >= 0; i--)
            printf("%d", digits[i]);
        printf("\n");
    }
};

int main() {
    int a, n;
    while (scanf("%d %d", &a, &n) != EOF) {
        std::vector<uint8_t> empty;
        Integer sum(empty);
        for (int i = 1; i <= n; i++) {
            Integer cur(std::vector<uint8_t>(i, a));
            sum += cur;
        }
        sum.print();
    }
}